<%@page language="java" contentType="text/html" pageEncoding="UTF-8"%>
<%@page errorPage="/pages/error.jsp" %>
<%@page import="java.io.File" %>
<%@page import="java.util.ArrayList" %>
<!DOCTYPE html>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>JACoMode</title>
        <meta name="author" content="Jonathan MERCIER, Louise-Amélie SCHMITT, Florence Maurier, Marianne Dussart, Nicolas Fontaine"/>
        <meta name="keywords" content="bioinformatique,bioinformatiques,bioinformatic,bioinformatics,open source,linux,software,logiciel,biologie,biology,ADN,DNA,protéine,proteomic,génomique,genomic,protéomique,proteomic,pathway,metatool,ACoM,JACoMode,Java,JEE,JSP,metabolic,network"/>
        <meta name="description" content="JACoMode it is a tool for analysis metabolic network"/>
        <meta name="ROBOTS" content="INDEX, FOLLOW"/>
        <link href="JACoMode.css" rel="stylesheet" type="text/css"/>
        <script type='text/javascript' src='/JACoMode/dwr/interface/Content.js'></script>
        <script type='text/javascript' src='/JACoMode/dwr/engine.js'></script>
        <script type='text/javascript' src='/JACoMode/dwr/util.js'></script>
        <script type="text/javascript" src='dynamicForward.js'></script>
    </head>
    <body>
        <div id="conteneur">
            <div id="header">
                <div class="hd"></div>
                <div class="bd"></div>
                <a href="index.jsp"><img src="IMAGES/JACoMode.png" width="270" height="60" alt="JACoMode.png"/></a><h2>Graphical frontend for ACoM</h2>
            </div>
            <div id="left">
                <div class="hg"></div>
                <div class="hd"></div>
                <div class="bg"></div>
                <div class="bd"></div>
                <p class="titleCenter" >Menu</p>
                <a href="#" title="Process new file"    onclick="forward('acomForm')"           onmouseover="return overImage('processNewFile')"       onMouseOut= "return outImage('processNewFile')"    ><img id="processNewFile"    src="IMAGES/buttons/processNewFile1.png"      width="180" height="46" alt="link to process new file web page" /></a><br/>
                <a href="resultTable" title="Table result"                                      onmouseover="return overImage('tableResult')"          onMouseOut= "return outImage('tableResult')"       ><img id="tableResult"       src="IMAGES/buttons/tableResult1.png"         width="180" height="46" alt="link to table result web page"     /></a><br/>
                <a href="#" title="Comparaison"         onclick="forward('compareForm')"        onmouseover="return overImage('compareStatistics')"    onMouseOut= "return outImage('compareStatistics')" ><img id="compareStatistics" src="IMAGES/buttons/compareStatistics1.png"   width="180" height="46" alt="link to statistics web page"       /></a><br/>
                <a href="#" title="Overall reaction"    onclick="forward('bilanForm')"          onmouseover="return overImage('overallReaction')"      onMouseOut= "return outImage('overallReaction')"   ><img id="overallReaction"   src="IMAGES/buttons/overallReaction1.png"     width="180" height="46" alt="link to overall reaction web page" /></a><br/>
                <a href="#" title="About JACoMode"      onclick="forward('about')"              onmouseover="return overImage('about')"                onMouseOut= "return outImage('about')"             ><img id="about"             src="IMAGES/buttons/about1.png"               width="180" height="46" alt="link to about web page"            /></a><br/>
            </div>
            <div id="center">
                <div class="hg"></div>
                <div class="hd"></div>
                <div class="bg"></div>
                <div class="bd"></div>

                <h1>Results</h1>
                <p>Click on the tabs to browse results.</p>
                <div class="menu1"> <!-- début de la boite contenant les onglets -->
                    <a class="onglet" href="selectWichAcomSession"      title="Acom Sessionn"           onclick="forward('selectWichAcomSession')">Acom Session</a> <!-- onglet inactif -->
                    <span class="onglet onglet-actif">Global result</span> <!-- onglet inactif -->
                    <a class="onglet" href="acomResultsByMotifSize"    title="Result by motif size"     onclick="forward('acomResultsByMotifSize')">By motif size</a><!-- onglet inactif -->
                    <a class="onglet" href="acomResultsByEFM"          title="Result by efm"            onclick="forward('acomResultsByEFM')">By EFM</a> <!-- onglet inactif -->
                    <div class="spacer"></div> <!-- permet le retour à la ligne à la fin des boites float -->
                </div>
                <fieldset>
                    <p>Files processed with parameter:</p>
                    <ul>
                        <%
                                    out.println("<li><span class=\"textBold\">File .dat: </span>" + ((File)request.getAttribute("fileDat")).getName() + "</li>");
                                    out.println("<li><span class=\"textBold\">File .out: </span>" +  ((File)request.getAttribute("fileOut")).getName() + "</li>");
                                    out.println("<li><span class=\"textBold\">Similarity threshold: </span>" + request.getAttribute("epsilon") + "</li>");
                                    out.println("<li><span class=\"textBold\">minimum motif size: </span>" + request.getAttribute("sigma") + "</li>");
                        %>
                    </ul>
                    <p>The java applet below might take some time loading and even make your browser freeze for a short while. Please be patient.</p>
                    <applet
                        code="fr.ubdx1.jacomode.clientSideApplet.GraphDisplay"
                        archive="applet/GraphDisplayApplet.jar,applet/graphstream.jar"
                        height="600"
                        width="800">
                        <%
                            ArrayList<String> motifs = (ArrayList<String>)request.getAttribute("motifs");
                            for (int i = 0; i < motifs.size(); i++)
                                {
                                    Integer param = i;
                                    out.println("<param name=param" + param.toString() + " value=\"" + motifs.get(i) + "\" >");
                                }
                        %>
                    </applet>
		    <p>To use the java applet above, you can click the reactions to color all the motifs it belongs to, and on the background to reset the coloring.
			<br />Click the buttons to toggle the layout from auto layout to Hasse diagram layout and back.
		    <br />You can also drag the reactions around for a better view.</p>

                    <h1>Global statistics</h1>
                    <ul>
                        <%
                                    out.println("<li>Mean class size: "                 + request.getAttribute("class_size")    + "</li>");
                                    out.println("<li>Number of classes: "               + request.getAttribute("nb_class")      + "</li>");
                                    out.println("<li>Mean motif size: "                 + request.getAttribute("motif_size")    + "</li>");
                                    out.println("<li>Number of different motif sizes: " + request.getAttribute("nb_motif_size") + "</li>");
                                    out.println("<li>Total number of EFM: "             + request.getAttribute("totalefm")      + "</li>");
                        %>
                    </ul>
                </fieldset>

                <p> Download results : <a href="download.tar.bz2" title="link">download archive (.tar.bz2) </a>

            </div>
            <div id="foot">
            </div>
        </div>
    </body>
</html>
